<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    hello
    <!-- comment -->
    <h1>hello</h1>
    <script>
      /*
        nodeValue/data
        1. 只有非标签节点才有的属性
        2. 获取非标签节点内的文本
        3. 是可读可写属性，对于html标签原样展示
        */
      const nodes = document.body.childNodes;
      console.log(nodes);
      console.log(nodes[0].nodeValue);
      console.log(nodes[1].nodeValue);
      setTimeout(() => {
        nodes[1].nodeValue = "hello abc comment";
        nodes[0].nodeValue = "hello abc <b>comment</b> ";
      }, 3000);

      // console.log(nodes[0].data);
      // console.log(nodes[1].data);
    </script>
  </body>
</html>
